package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.query.ReplyPageQuery;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 互动提问的问题表 前端控制器
 * </p>
 *
 * @author 东哥
 * @since 2023-11-06
 */
@Api(tags = "互动问答-管理端-回答的相关接口")
@RestController
@RequestMapping("/admin/replies")
@RequiredArgsConstructor
public class InteractionReplyAdminController {
    private final IInteractionReplyService replyService;

    @GetMapping("/page")
    public PageDTO<ReplyVO> adminQueryReply(ReplyPageQuery replyPageQuery) {
        return replyService.queryReply(replyPageQuery, false);
    }
    /**
     * day7，隐藏或显示互动问题，实战8
     * @param id
     * @param hidden
     */
    @PutMapping("/{id}/hidden/{hidden}")
    public void hiddenOrShowQuestion(@ApiParam("问题id") @PathVariable Long id,
                                     @ApiParam("是否隐藏") @PathVariable Boolean hidden){
        replyService.hiddenOrShowQuestion(id,hidden);
    }

}
